<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@page contentType="text/html;charset=utf-8" isELIgnored="false" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>个人信息 - 光年(Light Year Admin)后台管理系统模板</title>
    <link rel="icon" href="${base}/favicon.ico" type="image/ico">
    <meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
    <meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
    <meta name="author" content="yinqi">
    <link href="${base}/css/bootstrap.min.css" rel="stylesheet">
    <link href="${base}/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="${base}/css/style.min.css" rel="stylesheet">
</head>

<body>

<!--页面主要内容-->
<div class="container-fluid">
    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-body">
                    <div class="edit-avatar">
                        <img src="${base}/upload/${homeUser.headpic}" alt="..." class="img-avatar">
                        <div class="avatar-divider">
                            <c:choose>
                                <c:when test="${homeUser.id==theUser.id}">
                                    <span style="font-size: 20px">我的主页</span>
                                </c:when>
                                <c:otherwise>
                                    <span style="font-size: 20px">${homeUser.name}的主页</span>
                                </c:otherwise>
                            </c:choose>
                        </div>
                    </div>
                    <div class="form-group">
                        <span style="font-size: 15px">账号:${homeUser.account}</span>
                        &emsp;
                        <span style="font-size: 15px">发帖数:${plist.size()}</span>
                        &emsp;
                        <span style="font-size: 15px">获得点赞数:${homeSupports}</span>
                    </div>
                    <div style="font-size: 20px" class="form-group">
                        <c:choose>
                            <c:when test="${homeUser.id==theUser.id}">
                                <span style="font-size: 20px">我的帖子</span>
                            </c:when>
                            <c:otherwise>
                                <span style="font-size: 20px">他的帖子</span>
                            </c:otherwise>
                        </c:choose>
                    </div>
                    <hr style="height: 3px" color="pink">
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>类型</th>
                                    <th>标题</th>
                                    <th>内容</th>
                                    <th>点击量</th>
                                    <th>点赞数</th>
                                    <th>评论条数</th>
                                    <th>发布时间</th>
                                </tr>
                                </thead>
                                <tbody>
                                <c:forEach var="p" items="${plist}">
                                    <tr>
                                        <td>${p.pt.type}</td>
                                        <td>${p.title}</td>
                                        <td>
                                            <a style="color:black;" class="btn btn-xs btn-default" title="看帖子" href="${base}/post/lookPost?id=${p.id}" data-toggle="tooltip" target="midView">
                                                <c:if test="${fn:length(p.content)>20}">
                                                    ${fn:substring(p.content,0,20)}...
                                                </c:if>
                                                <c:if test="${fn:length(p.content)<=20}">
                                                    ${p.content}
                                                </c:if>
                                            </a>
                                        </td>
                                        <td>${p.click}</td>
                                        <td>${p.support}</td>
                                        <td>${p.comments}</td>
                                        <td><fmt:formatDate value="${p.time}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>
                            <a href="${base}/post/show" target="midView" class="btn btn-primary">返回论坛首页</a>
                        </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="${base}/js/jquery.min.js"></script>
<script type="text/javascript" src="${base}/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${base}/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="${base}/js/main.min.js"></script>
</body>
</html>